package cn.wolfcode.luowowo.controller;

import cn.wolfcode.luowowo.util.UploadUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import java.util.HashMap;
import java.util.Map;

/**
 *  旅游日记页面
 */
@Controller
public class UploadController {

    // 旅游日记页面:封面图片上传
    @RequestMapping("/coverImageUpload")
    @ResponseBody //不贴此注解405(插件返回的数据格式要求json格式)
    private String uploadImg(MultipartFile pic) throws Exception {
        //如何保存图片(MultipartFile pic 参数规定pic)
        String path = UploadUtil.uploadAli(pic);

        return path;//约定返回图片的路径
    }

}
